package me.huangxiang.data_structure_and_algorithm.sort;

import static me.huangxiang.data_structure_and_algorithm.sort.Util.swap;

public class BubbleSort {
    public static void bubbleSort(int[] a){
        int length = a.length;
        for (int i = 0; i < length; i++){
            for (int j = i + 1; j < length; j++){
                if (a[i] > a[j]){
                    swap(a, i, j);
                }
            }
        }
    }
}
